// 存放所有和组织架构 相关的接口

import request from '@/utils/request'

// 查询企业的部门列表
export const getDepartment = () => {
  return request({
    url: '/company/department'
  })
}

// 新增部门
export const addDepartment = (data) => {
  return request({
    url: '/company/department',
    method: 'POST',
    data
  })
}
// 获取部门详情  编辑
export const getDepartDetail = (id) => {
  return request({
    url: `/company/department/${id}`
  })
}
// 、、根据ID修改部门详情
// export const updateDepartment = (data) => {
//   return request({
//     url: `/company/department/${data.id}`,
//     method: 'put',
//     data
//   })
// }
export function updateDepartment(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'put',
    data
  })
}
/**
 * 删除部门
 * @param {*} id 部门 id
 * @returns promise
 */
export function delDepartment(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'delete'
  })
}
